using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;
using WindowsPhoneGame1.GamePlayStates;

namespace WindowsPhoneGame1.GameScreens
{
    class WorldSelectScreen : Screen
    {

        public WorldSelectScreen(Game1 game) : base(game)
        {
            NUMBER_OF_BUTTONS = 3;
        }

        public override void Initialize()
        {
            // call base.initialize first!
            base.Initialize();
            
            button_functions[0] = PressButton1;
            button_functions[1] = PressButton2;
            button_functions[2] = PressButton3;

            button_rectangle[0] = new Rectangle(290, 128, 256, 246);
            button_rectangle[1] = new Rectangle(575, 175, 156, 152);

        }

        public override void LoadContent()
        {
            button_texture[0] =
                game.Content.Load<Texture2D>("images/world0/menuIcon");
            button_texture[1] =
                game.Content.Load<Texture2D>("images/world1/menuIcon");
            button_texture[2] =
                game.Content.Load<Texture2D>("images/BoringButton");

            base.LoadContent();
        }

        public override void UnloadContent()
        {
            base.UnloadContent();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            game.GraphicsDevice.Clear(background_color);
            base.Draw(gameTime);
        }

        /* button press functions */
        private bool PressButton1(int world, int level)
        {
            background_color = Color.Green;
            game.SetScreen(new LevelSelectScreen(game, 0));
            return true;
        }

        private bool PressButton2(int world, int level)
        {
            background_color = Color.Yellow;
            game.SetScreen(new LevelSelectScreen(game, 1));
            return true;
        }

        private bool PressButton3(int world, int level)
        {
            background_color = Color.Yellow;
            game.SetScreen(new LevelSelectScreen(game, 2));
            return true;
        }
    }
}
